package ssh.service;

import lombok.Setter;
import ssh.dao.UserDao;
import ssh.entity.User;

import java.util.List;


public class UserService {
    @Setter
    private  UserDao userDao;


    public void  deleteById(Integer id){
        userDao.deleteById(id);
    }

    public List<User> list(){
        return userDao.selectList();
    }

    public void save(User user) {
        userDao.insert(user);
    }

    public User getById(Integer id) {
        return userDao.selectById(id);
    }

    public void update(User user) {
        userDao.update(user);
    }
}
